

const koa=require('koa');

const app=new koa();



app.use((ctx,next)=>{
  const start=Date.now();
  console.log('1');
  next();
  console.log('3');
  const  end=Date.now();
  console.log(`${ctx.method} ${end-start}ms`);
})

app.use((ctx,next)=>{
  console.log('2');
  ctx.body='hello koa';
})

app.listen(8080);
